Skip to content

add pebble exit() method#1617

Closed
devsnek wants to merge 1 commit into
Moddable-OpenSource:publicfrom
devsnek:pebble-exit
Closed

add pebble exit() method#1617
devsnek wants to merge 1 commit into
Moddable-OpenSource:publicfrom
devsnek:pebble-exit

Conversation

@devsnek

@devsnek devsnek commented May 27, 2026

Copy link
Copy Markdown
Contributor

This allows a pebble app to exit, especially useful if it has overridden the back button.

@phoddie

phoddie commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Nice. The code looks good. I don't think we have a CLA from you. If you would email an executed CLA to info@moddable.com we can get this merged for our June release. Thank you!

@devsnek

devsnek commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

@phoddie done :)

@phoddie

phoddie commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Received! Thanks you.

@phoddie

phoddie commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Closing as this has been merged and released as part of Moddable SDK 8.2.0.

One small question out of curiosity. The use of xsmcTest() here seems unnecessary. The main thing it avoids is calling app_exit_reason_set() when the reason is 0. But since APP_EXIT_NOT_SPECIFIED = 0, the end result should be the same with or without xsmcTest().

    if (xsmcArgc >= 1 && xsmcTest(xsArg(0)))
        app_exit_reason_set(xsmcToInteger(xsArg(0)));

@phoddie phoddie closed this Jun 4, 2026
@devsnek

devsnek commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

I was just trying to make the reason argument optional. 0 is the default anyway if you don't call app_exit_reason_set.

@devsnek devsnek deleted the pebble-exit branch June 5, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants